var $ = require('../../lib/jquery');
var util = require('./common/util');
var nav = require('./common/nav');
var _header = require('./common/header');
var template = require('../tpl/template');
var minHeight = require('./common/minHeight');
minHeight.init();
var _nav = new nav();
var header = new _header();
$('.js_zw').on('click',function(){
    window.location.href='./zwjc.html'
})
getList();
 var date= function date() {
    var date = new Date();
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    m = m < 10 ? ('0' + m) : m;
    var d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    return y + '年' + m + '月' + d +'日';
  }
  $('.js_date').html(date);
function time() {
    var date = new Date();
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    m = m < 10 ? ('0' + m) : m;
    var d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    return y + '-' + m + '-' + d ;
  }
function getList(){
    var _this=this;
    util.fetch('api/vision/queryList',{
        page:1,
        pageSize:7,
    }).then(function (res){
         var s='';
         for(var i=0;i<res.data.list.length && i<7;i++){
             s += '<div class="row bb"><div class="a bb up" >' + res.data.list[i].createTime + '</div> <div class="people bb down" >' + res.data.list[i].leftVision + '</div> <div class="people bb down " >' + res.data.list[i].leftEyeFlash + '</div><div class="people bb down " >' + res.data.list[i].rightVision + '</div><div class="people bb down " >' + res.data.list[i].rightEyeFlash + '</div> </div>'
         }
         $('.js_date_wrap').html(s);
    }).fail(function () {
        $('.noword').removeClass('hide');
        $('.con').hide();

    })
 }